package com.bwm.bwm007.main.fragment;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bwm.bwm007.R;

@SuppressLint("ValidFragment")
public class PictrueFragment extends Fragment {

    private int resId;
    private int index;
    private int all;

    @SuppressLint("ValidFragment")
    public PictrueFragment(int resId, int index, int all) {

        this.resId = resId;
        this.index = index;
        this.all = all;
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_pictrue, container, false);
        initViews(view);
        return view;
    }

    private void initViews(View view) {
        ImageView imageView = (ImageView) view.findViewById(R.id.scale_pic_item);
        imageView.setImageResource(resId);
        TextView tv = (TextView) view.findViewById(R.id.tv);
        tv.setText((index + 1) + "/" + all);
    }


}
